<?php

class Application_Model_DbTable_Categorias extends Zend_Db_Table_Abstract
{

    protected $_name = 'categorias';

	public function getCategoriasList() {
		$select  = $this->_db->select()
			->from($this->_name,array('key' => 'id_categoria','value' => 'nombre'));
		//print_r($select->__toString());die();
		$result = $this->getAdapter()->fetchAll($select);

		return $result;
	}
	
	public function getCategoriasFromId($idCategoria) {
		$select  = $this->_db->select()
			->from($this->_name)->where($this->_name.'.id_categoria = ?', $idCategoria);
		
		$result = $this->getAdapter()->fetchAll($select);

		return $result;
	}

}

